package com.kolon.business.mngr.service.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.kolon.business.mngr.service.dao.ServiceDao;
import com.kolon.framework.interfaces.SimpleController;

@Controller("com.kolon.business.mngr.service.controller.AppFdrNmChkController")
public class AppFdrNmChkController implements SimpleController {

	@Resource(name="com.kolon.business.mngr.service.dao.ServiceDaoImpl")
	private ServiceDao serviceDao;
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@RequestMapping(value="/business/mngr/service/appFdrNmChk.do")
	public ModelAndView controller(HttpServletRequest request,
		HttpServletResponse response) throws Exception {
		
		Map<String, String> map = new HashMap<String, String>();
		Map model = new HashMap();
		// 파라미터
		map.put("fdrNm", request.getParameter("fdrNm"));
		map.put("servTp", request.getParameter("servTp"));
		// 리턴
		model.put("cnt", serviceDao.getFdrNmCnt(map));
		return new ModelAndView("jsonView", model);
	}

}